package behaviorTree

import (
	"fmt"
)

var g_nextIds = map[string]int64{}

func GetNextId(groupName string) int64 {
	g_nextIds[groupName]++
	return g_nextIds[groupName]
}

var g_names = map[string]uint8{}

func UniqueName(name string) string {
	_, existed := g_names[name]
	if existed {
		panic(fmt.Sprintf("name:[%s] is not unique", name))
	}
	g_names[name] = 1
	return name
}
